home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 2.iso / STUTTGART / GRAPHICS / RAYTRACING / POVRAY3 / POV301 / povray3 / pov3demo / showoff / pov / smoke < prev    next >
Text File  |  1996-07-04  |  5KB  |  220 lines

  1. // Persistence Of Vision raytracer version 3.0 sample file.
  2. // File by Dan Farmer
  3.  
  4. #version 3.0
  5. global_settings { assumed_gamma 2.2 }
  6.  
  7. #include "colors.inc"
  8. #include "metals.inc"
  9. #include "textures.inc"
  10. #include "glass.inc"
  11. #include "metals.inc"
  12.  
  13. // Dummy glass for testing
  14. #declare Ashtray_Texture =
  15. texture {
  16.     T_Glass3
  17.     finish {
  18.         specular 0.3 roughness 0.01
  19.         caustics 1
  20.     }
  21. }
  22.  
  23.  
  24. camera {
  25.   location <-50, 45, -140>
  26.   angle 52
  27.   look_at <15, 10, 0>
  28. }
  29.  
  30. light_source{<-10, 100, 60> colour White }
  31.  
  32. // Cigarette smoke
  33. #declare Smoke =
  34. sphere { 0, 1
  35.     hollow
  36.     no_shadow
  37.     pigment { colour Clear }
  38.     halo {
  39.         linear
  40.         max_value 0.15
  41.         cylindrical_mapping
  42.         attenuating
  43.         turbulence 0.75
  44.         octaves 6
  45.         omega (1/1.618)
  46.         lambda 1.618
  47.         colour_map {
  48.              [0.0 color rgbt <1, 1, 1, 1>]
  49.              [0.5 color rgbt <1, 1, 1, 0.65>]
  50.              [1.0 color rgbt <0, 0, 0, 0>]
  51.         }
  52.         scale <0.4, 0.65, 0.4>
  53.         samples 10
  54.         aa_level 0
  55.         aa_threshold 0.3
  56.     }
  57.     scale <10, 30, 10>
  58.     translate <-5, 40, 0>
  59. }
  60.  
  61.  
  62. // Glowing ashes
  63. #declare GlowTip =
  64.     cylinder { -y, y, 1  hollow
  65.     no_shadow
  66.     pigment { colour Clear }
  67.     halo {
  68.         linear
  69.         max_value 0.15
  70.         cylindrical_mapping
  71.         turbulence 0.3
  72.         colour_map {
  73.              [0.0 color rgbt <1, 0.5, 0, 1>]
  74.              [0.95 color rgbt <1, 0.5, 0, 0>]
  75.         }
  76.         samples 10
  77.         aa_level 0
  78.         aa_threshold 0.3
  79.         scale <0.75, 1.1, 1.1>
  80.     }
  81.     rotate z*90
  82.     scale <2.0, 7.5, 7.5>
  83.     translate -x*3                   // position at ash tip of cigarette
  84. }
  85.  
  86. #declare Cigarette =
  87. union {
  88.     object { Smoke }
  89.     union {
  90.         // Glow surrounding burned tip
  91.         object { GlowTip}
  92.  
  93.         // ashes... a cylinder with rounded cap ends
  94.         superellipsoid { <1.0, 0.65> scale <4, 4, 5> rotate y*90
  95.             pigment {
  96.                 gradient x
  97.                 turbulence 0.35
  98.                 color_map {
  99.                     [ 0.00 Gray60 ]       // ashes
  100.                     [ 0.05 Gray20 ]       // dark burned area
  101.                     [ 0.10 Gray60 ]       // ashes
  102.                     [ 0.15 Gray20 ]       // dark burned area
  103.                     [ 0.20 Gray60 ]       // ashes
  104.                     [ 0.25 Gray20 ]       // dark burned area
  105.                     [ 0.30 Gray60 ]       // ashes
  106.                     [ 0.50 Gray20 ]       // dark burned area
  107.                     [ 0.60 Orange ]      // a little extra glow
  108.                     [ 0.85 red 0.4 ]
  109.                     [ 0.90 Gray20 ]
  110.                     [ 1.00 White ]
  111.                 }
  112.                 scale 5.5
  113.                 translate -x*5
  114.             }
  115.             finish { ambient 0.4 }
  116.         }
  117.  
  118.         // unburned portion of cigarette
  119.         union {
  120.             // white part
  121.             cylinder { x, x*73 , 4 open
  122.                 pigment {
  123.                     gradient x      // lightly banded paper
  124.                     color_map {
  125.                         [0.5 White ]
  126.                         [0.5 White*0.95 ]
  127.                         [1.0 White ]
  128.                     }
  129.                 }
  130.                 finish { crand 0.05 ambient 0.30 diffuse 0.6 }
  131.             }
  132.             // Gold band
  133.             cylinder { x*73 x*73.5, 4 open
  134.                 texture {
  135.                     pigment { Tan }
  136.                     finish { metallic ambient 0.3 diffuse 0.7 }
  137.                 }
  138.             }
  139.             // White band
  140.             cylinder { x*73.5 x*75 , 4 open
  141.                 texture {
  142.                     pigment { White }
  143.                     finish { crand 0.15 ambient 0.30 diffuse 0.6 }
  144.                 }
  145.             }
  146.             // Gold band
  147.             cylinder { x*75 x*75.5, 4 open
  148.                 texture {
  149.                     pigment { Tan }
  150.                     finish { metallic ambient 0.3 diffuse 0.7 }
  151.                 }
  152.             }
  153.             // White band
  154.             cylinder { x*75.5 x*77 , 4 open
  155.                 texture {
  156.                     pigment { White }
  157.                     finish { crand 0.15 ambient 0.30 diffuse 0.6 }
  158.                 }
  159.             }
  160.  
  161.             // filter part
  162.             cylinder { x*77, x*100 , 4 open
  163.                 texture {
  164.                 Cork
  165.                 scale 30
  166.                     finish { crand 0.15 ambient 0.30 diffuse 0.6 }
  167.                 }
  168.             }
  169.         }
  170.         rotate z*9
  171.     }
  172.     translate -y*12
  173. }
  174.  
  175.  
  176. #declare FloorPlane =
  177. plane { y, -20.001 pigment { Blue } }
  178.  
  179. // Cutout for notches in ashtray
  180. #declare Groove =
  181. union {
  182.     cylinder { <0,0,0>, <0, 0, 1>, 1 }
  183.     box { <-1 0, 0> <1, 5, 1> }
  184.     scale <5, 5, 50>
  185.     translate y*5
  186. }
  187.  
  188.  
  189. // Ashtray
  190. #declare Ashtray =
  191. difference {
  192.  
  193.     // Make outside shape
  194.     superellipsoid { <0.5, 0.1> rotate x*90 scale <40, 10, 40> }
  195.  
  196.     // Cut out inside shape
  197.     superellipsoid { <0.8, 0.2> rotate x*90 scale <35, 20, 35> translate y*12 }
  198.  
  199.     // Cut out grooves
  200.     union {
  201.         object { Groove rotate y*0 }
  202.         object { Groove rotate y*90 }
  203.         object { Groove rotate y*180 }
  204.         object { Groove rotate y*270 }
  205.     }
  206.     texture {
  207.         Ashtray_Texture
  208.         finish {
  209.             caustics 2
  210.         }
  211.     }
  212.     translate -y*10
  213. }
  214.  
  215. object { FloorPlane }
  216. union {
  217.     object { Cigarette }
  218.     object { Ashtray }
  219. }
  220.